package com.xmy.cultivate.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.xmy.cultivate.respons.ResTranscriptScore;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 学生表
 * </p>
 *
 * @author min
 * @since 2022-07-28
 */
@Data
public class Student implements Serializable {

    /**
     * id
     */
    @ExcelIgnore
    private Long id;

    /**
     * 所属校区
     */
    @ExcelIgnore
    private Long schoolId;

    @ExcelIgnore
    private Long readingSchoolId;

    @ExcelIgnore
    private String idCardNo;

    /**
     * 姓名
     */
    @ExcelProperty(index = 0,value = "学员姓名")
    private String name;

    /**
     * 姓名音频地址
     */
    @ExcelIgnore
    private String nameAudioPath;

    /**
     * 备注
     */
    @ExcelIgnore
    private String remark;

    /**
     * 头像
     */
    @ExcelIgnore
    private String headImg;

    /**
     * 性别：1男，2女，3未知
     */
    @ExcelIgnore
    private Integer sex;

    /**
     * 公立校班级
     */
    @ExcelIgnore
    private String className;

    /**
     * 年级id(为了与其它表相同，添加了year_class_id字段，此字段作废)
     */
    @ExcelIgnore
    private Integer gradeId;

    /**
     * 年级id
     */
    @ExcelIgnore
    private Integer yearClassId;

    /**
     * 所在学校
     */
    @ExcelIgnore
    private String schoolName;

    /**
     * 地址
     */
    @ExcelIgnore
    private String address;

    /**
     * 1正常
     */
    @ExcelIgnore
    private Integer status;

    /**
     * 微信是否关注
     */
    @ExcelIgnore
    private Integer isGuanzhu;

    /**
     * 是否人脸采集
     */
    @ExcelIgnore
    private Integer isGather;

    /**
     * 人脸采集id
     */
    @ExcelIgnore
    private String entityId;

    @ExcelProperty(index = 2,value = "关系")
    private String linkman;

    @ExcelProperty(index = 3,value = "联系电话")
    private String linkmanPhone;

    /**
     * 等级
     */
    @ExcelIgnore
    private Integer level;

    /**
     * 创建人
     */
    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT)
    private Long createdId;

    @ExcelIgnore
    @TableLogic
    private Integer deleted;

    /**
     * created_at
     */
    @ExcelIgnore
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createdAt;

    /**
     * 类型，1报名，2为试听
     */
    @ExcelIgnore
    private Integer stuType;

    /**
     * updated_at
     */
    @ExcelIgnore
    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime updatedAt;

    @ExcelIgnore
    @TableField(exist = false)
    private List<Map<String,Object>> schoolList;//报读学校

    @ExcelIgnore
    @TableField(exist = false)
    private List<TypeValueData> linkManList;//联系人

    /**
     * 在读课程数
     */
    @ExcelIgnore
    @TableField(exist = false)
    private Integer courseCount;


    /**
     * deleted_at
     */
    @ExcelIgnore
    private LocalDateTime deletedAt;

    /**
     * 报读的课程数
     */
    @ExcelIgnore
    @TableField(exist = false)
    private Integer applyCourseCount;

    @ExcelIgnore
    @TableField(exist = false)
    private List<RecordCourse> recordCourseList;

    /**
     * 欠费金额
     */
    @ExcelIgnore
    @TableField(exist = false)
    private BigDecimal ownPrice;

    /**
     * 报读校区列表
     */
    @ExcelIgnore
    @TableField(exist = false)
    private List<Organization> signUpSchoolList;

    /**
     * 共多少课时
     */
    @ExcelProperty(index = 4,value = "总课次")
    @TableField(exist = false)
    private Integer allCourseCount;



    /**
     * 剩余课时
     */
    @ExcelProperty(index = 5,value = "剩余课次")
    @TableField(exist = false)
    private Integer residueCourseCount;

    /**
     * 使用课时
     */
    @ExcelProperty(index = 6,value = "已用课次")
    @TableField(exist = false)
    private Integer useCourseCount;

    /**
     * 班级id
     */
    @ExcelIgnore
    @TableField(exist = false)
    private Long classId;

    /**
     * 学员报读状态
     * 在读，停课，结课
     */
    @ExcelProperty(index = 9,value = "学员状态")
    @TableField(exist = false)
    private String state;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer courseStatus;

    @ExcelIgnore
    @TableField(exist = false)
    private Long subjectsId;

    @ExcelIgnore
    @TableField(exist = false)
    private Long courseNum;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer courseType;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer isCheckHouse;

    /**
     * 期末成绩
     */
    @ExcelIgnore
    @TableField(exist = false)
    List<ResTranscriptScore> transcriptList;

    /**
     * 期中成绩
     */
    @ExcelIgnore
    @TableField(exist = false)
    List<ResTranscriptScore> midtermTranscriptList;

    @ExcelIgnore
    @TableField(exist = false)
    private String studentAccount;

    @ExcelIgnore
    @TableField(exist = false)
    private String studentPwd;

    @ExcelProperty(index = 11,value = "是否核对")
    @TableField(exist = false)
    private String isCheckHouseStr;

    @TableField(exist = false)
    @ExcelProperty(index = 10,value = "课时状态")
    private String courseStatusStr;

    @ExcelProperty(index = 1,value = "性别")
    @TableField(exist = false)
    private String sexStr;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer count;

    @ExcelProperty(index = 7,value = "到课数量")
    @TableField(exist = false)
    private Integer arriveCount;

    @ExcelProperty(index = 8,value = "请假数量")
    @TableField(exist = false)
    private Integer repairCount;

    @ExcelIgnore
    @TableField(exist = false)
    private Long trunschoolId;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer allTransferCount;

    @ExcelIgnore
    @TableField(exist = false)
    private String verifyCode;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer addType;

    @ExcelIgnore
    @TableField(exist = false)
    private Integer schedulingType;

    @ExcelIgnore
    @TableField(exist = false)
    private String readingSchoolName;

    @ExcelIgnore
    @TableField(exist = false)
    private List<String> readingSchoolNameList;

    /**
     * 经办日期
     */
    @ExcelIgnore
    @TableField(exist = false)
    private String handleDate;
}
